package mylab.usm.oauth2.server.utils;

import com.fujieid.jap.http.JapHttpCookie;
import com.fujieid.jap.http.JapHttpRequest;
import com.fujieid.jap.http.JapHttpResponse;
import com.fujieid.jap.http.JapHttpSession;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import lombok.experimental.UtilityClass;
import mylab.usm.jap.httpAdapter.jakarta.JakartaAdapterUtil;

/**
 * @Description:
 * @author: Sylar
 * @date: 2021年12月02日 3:01 下午
 */
@UtilityClass
public class HttpUtil {

    public JapHttpRequest wrap(HttpServletRequest request) {
        return JakartaAdapterUtil.request(request);
    }

    public JapHttpResponse wrap(HttpServletResponse response) {
        return JakartaAdapterUtil.response(response);
    }

    public JapHttpCookie wrap(Cookie cookie) {
        return JakartaAdapterUtil.cookie(cookie);
    }

    public JapHttpSession wrap(HttpSession session) {
        return JakartaAdapterUtil.session(session);
    }
}
